﻿using Brc_PaaS.Common.Model.Basic;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;

namespace Brc_PaaS.Common.Model.Exceptionless
{
    public class WriteLogModel
    {
        /// <summary>
        /// 日志信息
        /// </summary>
        [Required(ErrorMessage = "日志信息不能为空")]
        public string Message { get; set; }
        /// <summary>
        /// 日志类型
        /// </summary>
        [Required(ErrorMessage = "日志类型不能为空")]
        public PaaSLogLevel Level { get; set; }
        /// <summary>
        /// 日志自定义标签
        /// </summary>
        public string[] Tags { get; set; }
    }
    /// <summary>
    /// 查询日志请求模型
    /// </summary>
    public class QueryEventModel
    {
        /// <summary>
        /// 查询类型（log:日志，error:异常）
        /// </summary>
        [Required(ErrorMessage = "查询类型不能为空")]
        public QueryEventType Type { get; set; }
        /// <summary>
        /// 自定义标签
        /// </summary>
        public string Tags { get; set; }
        /// <summary>
        /// 日志类型（仅限查询日志使用，异常不用）
        /// </summary>
        public PaaSLogLevel? Level { get; set; }

        /// <summary>
        /// 当前页
        /// </summary>
        [Required(ErrorMessage = "当前页不能为空")]
        [Range(1, 1000, ErrorMessage = "只能输入1-1000之间的整数")]
        public int Page { get; set; }
        /// <summary>
        /// 每页限制数
        /// </summary>
        [Required(ErrorMessage = "每页显示数不能为空")]
        [Range(1, 100, ErrorMessage = "只能输入1-100之间的整数")]
        public int Limit { get; set; }
        /// <summary>
        /// 开始时间
        /// </summary>
        public DateTime? StartTime { get; set; }
        /// <summary>
        /// 结束时间
        /// </summary>
        public DateTime? EndTime { get; set; }       
    }

    public class WriteExceptionModel
    {

        /// <summary>
        /// 异常消息
        /// </summary>
        [Required(ErrorMessage = "异常消息不能为空")]
        public string Message { get; set; }
        /// <summary>
        /// 异常类型
        /// </summary>
        [Required(ErrorMessage = "异常类型不能为空")]
        public string Type { get; set; }
        /// <summary>
        /// 堆栈
        /// </summary>
        [Required(ErrorMessage = "异常堆栈不能为空")]
        public string Stack_Trace { get; set; }
        
        /// <summary>
        /// 异常自定义标签
        /// </summary>
        public string[] Tags { get; set; }
      
    }
    public enum QueryEventType
    {
        log = 0,
        error = 1
    }


}
